package qianting.news.apis.services.article;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import qianting.news.apis.models.article.dtos.ArticleCommentDto;
import qianting.news.apis.models.article.dtos.ArticleDto;
import qianting.news.apis.models.article.dtos.CommentConfigDto;
import qianting.news.apis.models.article.dtos.StatisticsDto;
import qianting.news.apis.services.article.fallback.IArticleClientFallback;
import qianting.news.common.entity.State;

import java.util.Date;

@FeignClient(value = "article-service",fallback = IArticleClientFallback.class)
public interface IArticleClient {

    @PostMapping("/article/api/save")
    public State saveArticle(@RequestBody ArticleDto dto) ;

    @GetMapping("/article/api/queryLikesAndConllections")
    State queryLikesAndConllections(@RequestParam("wmUserId") Long wmUserId,@RequestParam("beginDate") Date beginDate,@RequestParam("endDate") Date endDate);

    @PostMapping("/article/api/newPage")
    State newPage(@RequestBody StatisticsDto dto);

    @GetMapping("/article/api/findArticleConfigByArticleId/{articleId}")
    State findArticleConfigByArticleId(@PathVariable("articleId") Long articleId);

    @PostMapping("/article/api/findNewsComments")
    public State findNewsComments(@RequestBody ArticleCommentDto dto);

    @PostMapping("/article/updateCommentStatus")
    public State updateCommentStatus(@RequestBody CommentConfigDto dto);

}